home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-06-04 | 4.3 KB | 138 lines | [TEXT/MPS ] |
- #
- # File: AppleLink.vu
- #
- # Contains: Sample demo working with AppleLink 6.1. Note that this script
- # cannot handle the dialogs that appear the first time AppleLink is run.
- # Make sure that AppleLink has been run at least once and that
- # the setup dialogs have been properly dismissed so they will not
- # come up on subsequent executions.
- #
- # Written by: David Gaxiola
- #
- # Copyright: © 1992 by Apple Computer, Inc., all rights reserved.
- #
- # Requirements: AppleLink 6.1 on target machine.
- #
- # After Effects: The file specified by the script parameter savedName is
- # created in the default folder on the target.
- #
- # Change History (most recent first):
- #
- # <4+> 12/3/92 RV
- # 7/1/92 DGG Created.
- #
- # To Do:
- #
-
- Libraries "Time.vulib","UtilityTasks.vulib","StandardDialogs.vulib","DataUtils.vulib","QuickTasks.vulib";
-
- (************************************************************************************
- * Task EditAddressBook()
- * This task will perform operations on the AppleLink address book, using the
- * global gTheAddress as the AppleLink address to enter. It takes no parameters
- * and returns nothing.
- ************************************************************************************)
- task EditAddressBook()
- begin
- userName := "VU Test Name";
- global gTheAddress;
-
- select [menuItem t:/Edit Addr≈/ m:"Edit"];
-
- CurWindow := match[ window o:1 ]!;
- select [button t:"New Entry" w:[window o:1]];
- WaitForNoMatch( CurWindow );
-
- type k:{userName, tabKey, gTheAddress};
- select [button t:"OK" w:[window t:"Address Book Editor" o:1]];
-
- close [window t:"Address Book Editor" o:1];
- if (match [window s:dialog o:1])
- select [button t:"Save" w:[window o:1]];
- end;
-
- (************************************************************************************
- * Task GenerateSomeText()
- * This task will output a message to the currently active window.
- ************************************************************************************)
- task GenerateSomeText()
- begin
- theCatcher := "and again";
- theListOfStrings := {
- "Welcome to Virtual User 2.0!",
- "We here at Apple are really excited that you chose our product.",
- "It represents a lot of time spent on research and development of",
- "the next step in Automated Testing.",
- "We think you'll find it fun and productive to use,",
- "and hopefully you'll come back to VU again and again."
- };
-
- type k:{theCatcher, returnKey};
- UseKeyboardEquivalent("a");
- UseKeyboardEquivalent("x");
-
- for each singleString in theListOfStrings
- type k:{singleString, returnKey};
- for counter := 1 to 5
- UseKeyboardEquivalent("v");
- end;
-
- (************************************************************************************
- * Task SelectSendButton()
- * This task will click on the "send" button in AppleLink 6.1 in the a memo window.
- ************************************************************************************)
- task SelectSendButton()
- begin
- largeScreenX := 468;
- smallScreenX := 400;
- buttonY := 30;
-
- match [screen m:true r:?screenDimensions];
- if (Abs(screenDimensions[1] - screenDimensions[3]) < 640)
- FindObjectInWindow(smallScreenX, 30);
- else
- FindObjectInWindow(largeScreenX, 30);
- click;
- end;
-
- (************************************************************************************
- * script MainApplelink(savedName)
- * This is the main driving part of this script.
- ************************************************************************************)
- script MainApplelink(savedName := "VU AppleLink Demo")
- begin
- # Define variables.
- global gTheAddress := "TOTALLYFAKEAPPLELINKADDRESS@UNREALNET#";
-
- Launch( 'GEOL', true );
-
- if (not WaitForMatch( [ menuitem t:/AppleLink≈/ ] ))
- begin
- LogError("Failed to launch AppleLink 6.1 application!", false);
- exit;
- end;
- else
- begin
- Select[ menuitem t:/AppleLink≈/ ];
- WaitForMatch( [ application t:/AppleLink≈/ ] );
- end;
-
- # Edit the address book.
- EditAddressBook();
-
- # Create a new memo and enter a message.
- select [menuItem t:"New Memo" m:[menu t:"File" o:2]];
- WaitForMatch( [window t:"Untitled" ] );
- GenerateSomeText();
-
- # Send the memo.
- SelectSendButton();
- type k:{gTheAddress};
- type k:{tabKey, tabKey};
- type k:{"Virtual User Test!"};
- select [button t:"Send" w:[window s:dialog o:1]];
-
- # Save the memo and clean up.
- DoSaveAs(savedName);
- close [window t:savedName];
- end;